package 笔试强训;

import java.util.Arrays;
import java.util.Scanner;

public class _0417T3 {
    public static int max(int a,int b,int c) {
        if(a>=b&&a>=c) return a;
        else if(b>=a&&b>=c) {
            return b;
        }else {
            return c;
        }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] nums = new int[n];
        int i = 0;
        int sum = 0;
        int tmp = n;
        while(i!=tmp) {
            int num = scanner.nextInt();
            if(num%2==1) {
                tmp--;
            }
            else {
                nums[i++] = num;
            }
            sum+=num;
        }
        Arrays.sort(nums);
        int index = n-1;
        int start = n-tmp;
        int end = n;
        while(k!=0&&index>=start&&index<end) {
            if(index==end-1) {
                if(nums[index]%2==0&&nums[index]>=nums[index-1]) {
                    nums[index] = nums[index]/2;
                    sum-=nums[index];
                    k--;
                }else {
                    index--;
                    end--;
                }
            }else if(index==start) {
                nums[index] = nums[index]/2;
                sum-=nums[index];
                if(nums[index]%2==1) {
                    break;
                }
                k--;
            }else {
                nums[index] = nums[index]/2;
                sum-=nums[index];
                k--;
                int max = max(nums[index+1],nums[index],nums[index-1]);
                if(max==nums[index+1]) {
                    index++;
                }else if(max==nums[index]) {

                }else {
                    index--;
                }
            }
        }
        System.out.println(sum);
    }
}
